<template>
  <min-dialog-box class="allMute" :dialogData="dialogData" @submitBtnEvent="submit" @cancelBtnEvent="cancel"
                  v-if="ifShowDialog">
    <el-checkbox v-model="ifAllowMemberRelieve"></el-checkbox>
  </min-dialog-box>
</template>

<script>
import { sendSock } from '@/utils/socketSend'

export default {
  name: 'allMute',
  data () {
    return {
      // 是否允许成员自我解除静音
      ifAllowMemberRelieve: false,
      // 是否显示该弹窗
      ifShowDialog: false
    }
  },
  computed: {
    // 弹窗数据
    dialogData () {
      return {
        mainTips: ['所有以及新加入的成员将被静音'],
        subTips: '允许成员自我解除静音',
        btnList: [{
          name: '确定',
          color: 'blue',
          type: 'submit'
        }, {
          name: '取消',
          color: 'white',
          type: 'cancel'
        }]
      }
    },
    // 当前会议ID
    cf_id () {
      return this.$store.state.conferenceRoom.cf_id
    }
  },
  methods: {
    // 操作自身显示/隐藏
    toggleShow () {
      this.ifShowDialog = !this.ifShowDialog
    },
    // 确认全体静音
    submit () {
      sendSock({
        type: '4.1.12',
        body: {
          cf_id: this.cf_id
        }
      })
      this.toggleShow()
    },
    // 取消
    cancel () {
      this.toggleShow()
    }
  }
}
</script>

<style scoped lang="scss">
.allMute {

}
</style>
